package com.jdpc.weparty.component

import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.SerializationFeature
import org.springframework.context.annotation.Bean
import org.springframework.stereotype.Component

@Component
class ObjectMapperConfiguration {
    //为了防止发生kotlin-model-jackson通过@RequestBody解析java.lang.object时发生错误。添加如下代码
    @Bean
    fun objectMapper(): ObjectMapper {
        return ObjectMapper().disable(SerializationFeature.FAIL_ON_EMPTY_BEANS)
    }
}